package com.shujia.io;

import java.io.*;

public class Demo1 {
    public static void main(String[] args) throws Exception {
        /**
         * 字节流
         *
         * 在读取图片视频音乐的时候使用字节流
         *
         *
         */
        FileInputStream fileInputStream = new FileInputStream("java/data/words.txt");
        FileOutputStream fileOutputStream = new FileOutputStream("java/data/words.txt");

        /**
         * 字节缓冲流 提高读写速度
         * 可以设置缓冲区大小
         */
        BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);
        BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(fileOutputStream);


        /**
         * 字符流  处理文本文件
         *
         */

        FileReader fileReader = new FileReader("java/data/words.txt");
        FileWriter fileWriter = new FileWriter("java/data/words.txt");


        BufferedReader bufferedReader = new BufferedReader(fileReader);
        BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);


        /**
         * 字节流转换成字符流
         */

        InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream);
        OutputStreamWriter outputStreamWriter = new OutputStreamWriter(fileOutputStream);

        /**
         * 对象流   读写对象   java所有对象    对象必须可以序列化    implements Serializable
         *
         */

        ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream);
        ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream);




    }
}
